package check1_9;

import java.util.ArrayList;
import java.util.List;

/**
 * @author dcf
 * @date 2019/9/24
 */
public class Task2 {
    public static void main(String[] args) {
        //存放天数
        List<Integer> days = new ArrayList<>();
        //统计总的停电天数
        int count = 0;
        for (int i=1;(i*i+i)/2<62;i++){
            //1 3 6 10 15 21 28 36 45 55 67
            days.add((i*i+i)/2);
        }
        for (int i= 0; i<days.size();i++){
            if(days.get(i)>31){
                count++;
                System.out.print("8月份的日期"+(days.get(i)-31)+" ");
            }else {
                count++;
                System.out.print("7月份的日期"+days.get(i)+" ");
            }
        }
        System.out.println("总的停电天数"+count);
    }
}
